﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Autorent.Desktop.Main;
using Autorent.Desktop.Modules.Reports.OfficesReports.ReportsDataSets;
using Autorent.Desktop.Modules.Reports.OfficesReports.ViewModels;
using Autorent.Desktop.Modules.Reports.CompanyReports;
using Autorent.Desktop.Modules.Reports.CompanyReports.ViewModels;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;

namespace Autorent.Desktop.Modules.Reports.ViewModels
{
    public class MainReportsViewModel : ViewModelBase
    {
        public MainReportsViewModel(MainReportsView view, IUnityContainer container, IRegionManager regionManager)
        {
            View = view;
            View.Model = this;

            _container = container;
            _regionManager = regionManager;
        }

        public MainReportsView View { get; set; }

        public ICommand MonthOfficeReport
        {
            get
            {
                return new RelayCommand(param => monthOfficeReport());
            }
        }

        public ICommand YearOfficeReport
        {
            get
            {
                return new RelayCommand(param => yearOfficeReport());
            }
        }

        public ICommand MonthCompanyReport
        {
            get
            {
                return new RelayCommand(param => monthCompanyReport());
            }
        }

        public ICommand YearCompanyReport
        {
            get
            {
                return new RelayCommand(param => yearCompanyReport());
            }
        }

        private readonly IUnityContainer _container;
        private readonly IRegionManager _regionManager;

        private void monthOfficeReport()
        {
            View.ccReportView.Content = _container.Resolve<SummaryMonthOfficeReportViewModel>().View;
        }

        private void yearOfficeReport()
        {
            
        }

        private void monthCompanyReport()
        {
            View.ccReportView.Content = _container.Resolve<CompanyMonthReportViewModel>().View;
        }

        private void yearCompanyReport()
        {
            View.ccReportView.Content = _container.Resolve<CompanyYearReportViewModel>().View;
        }
    }
}
